package net.tngou.quartz;


import java.io.File;
import java.io.IOException;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import org.apache.commons.configuration2.Configuration;
import org.apache.commons.io.FileUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.tngou.jdbc.DBManager;
import net.tngou.jdbc.QueryHelper;





public class DayUpdateJob implements Job {
	private static Logger _log = LoggerFactory.getLogger(DayUpdateJob.class);
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		_log.info("执行作业： "+context.getJobDetail().getKey() +"  执行时间："+new Date()+"********************************");	
		
		System.err.println("开始定时更新数据*********************");
	
	
		QueryHelper.update("DELETE FROM cache WHERE t<=DATE_ADD(NOW(),INTERVAL -1 MONTH)");
		
		DBManager.closeConnection();
		System.err.println("完成定时更新数据*********************");
	}
	
	

	
	
	
}
